<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<strong><%@ taglib prefix="c"
                   uri="http://java.sun.com/jsp/jstl/core" %></strong>
<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>拍卖会作品</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" href="/xAdmin/css/font.css">
    <link rel="stylesheet" href="/xAdmin/css/xadmin.css">
    <link rel="stylesheet" href="/xAdmin/lib/layui/css/layui.css"  media="all">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="/xAdmin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/xAdmin/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <form method="post" class="layui-form">
            <input type="hidden" value="${artcode}" id="artcode">
            <input type="hidden" value="${auctionId}" id="auctionId">
            <input type="hidden" value="${taa.id}" id="id">
            <div class="layui-form-item">
                <label for="statingprice" class="layui-form-label">
                    起拍价格
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="statingprice" name="statingprice" required="" lay-verify="required"
                           autocomplete="off" class="layui-input" value="${taa.statingprice}">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label for="increaseprice" class="layui-form-label">
                        每次最低加价价格
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="increaseprice" name="increaseprice" required="" lay-verify="required"
                               autocomplete="off" class="layui-input" value="${taa.increaseprice}">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label for="bottomprice" class="layui-form-label">
                        保底价
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="bottomprice" name="bottomprice" required="" lay-verify="required"
                               autocomplete="off" class="layui-input" value="${taa.bottomprice}">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label for="count" class="layui-form-label">
                        数量
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="count" name="count" required="" lay-verify="required"
                               autocomplete="off" class="layui-input" value="${taa.count}">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label for="commission" class="layui-form-label">
                        佣金
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" id="commission" name="commission" required="" lay-verify="required"
                               autocomplete="off" class="layui-input" value="${taa.commission}">
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label for="stateTime" class="layui-form-label">
                        开始时间
                    </label>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" id="stateTime" name="stateTime"
                               placeholder="yyyy-MM-dd HH:mm:ss" value="${taa.stateTime}">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label for="endTime" class="layui-form-label">
                    结束时间
                </label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" id="endTime" name="endTime"
                           placeholder="yyyy-MM-dd HH:mm:ss" value="${taa.endTime}">
                </div>
            </div>



            <div class="layui-form-item">
                <label class="layui-form-label">
                </label>
                <button type="button" class="layui-btn" lay-filter="add"  onclick="Issubmit()">
                    确定
                </button>
            </div>

        </form>
    </div>
</div>
<script>
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        laydate.render({
            elem: '#stateTime'
            ,type: 'datetime'
            ,eventElem: '#stateTime'
            ,trigger: 'click'
        });
        laydate.render({
            elem: '#endTime'
            ,type: 'datetime'
            ,eventElem: '#endTime'
            ,trigger: 'click'
        });
    });

    function Issubmit(){
        var data={
            id:$('#id').val(),
            artcode:$('#artcode').val(),
            auctionid:$('#auctionId').val(),
            statingprice:$('#statingprice').val(),
            increaseprice:$('#increaseprice').val(),
            bottomprice:$('#bottomprice').val(),
            stateTime:$('#stateTime').val(),
            endTime:$('#endTime').val(),
            commission:$('#commission').val(),
            count:$('#count').val()
        }
        $.ajax({
            url:"/tBizAuction/aaSave",
            type:'post',
            dataType:'text',
            contentType: 'application/json',
            data:JSON.stringify(data),
            timeout:2000,
            success:function(data){
                var datas =JSON.parse( data );
                console.log(datas.oper_res);
                var layer = parent.layui.layer;
                if(datas.oper_res == 'success')
                    layer.msg('操作成功!',{icon:1,time:1000});
                else
                    layer.msg('操作失败!',{icon:1,time:1000});
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            },
            error:function () {
                var layer = parent.layui.layer;
                layer.msg("操作失败",{icon:1,time:1000});
            }
        })
    }

</script>

</body>

</html>
